Skip to content

nmixer: always use "%s"-style format for printf()-style functions#8

Open
trofi wants to merge 1 commit intostragulus:masterfrom
trofi:master
Open

nmixer: always use "%s"-style format for printf()-style functions#8
trofi wants to merge 1 commit intostragulus:masterfrom
trofi:master

Conversation

@trofi
Copy link
Copy Markdown

@trofi trofi commented Nov 16, 2021

ncuses-6.3 added printf-style function attributes and now makes
it easier to catch cases when user input is used in palce of format
string when built with CFLAGS=-Werror=format-security:

nmixer.cc:219:26: error: format not a string literal and no format arguments [-Werror=format-security]
  219 |                 mvwprintw(mixwin, my_y - 1, my_x, (char*)source);
      |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Let's wrap all the missing places with "%s" format.

`ncuses-6.3` added printf-style function attributes and now makes
it easier to catch cases when user input is used in palce of format
string when built with CFLAGS=-Werror=format-security:

    nmixer.cc:219:26: error: format not a string literal and no format arguments [-Werror=format-security]
      219 |                 mvwprintw(mixwin, my_y - 1, my_x, (char*)source);
          |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Let's wrap all the missing places with "%s" format.
@Mart-Bogdan
Copy link
Copy Markdown

👍 for this one. I have encountered this problem when tried to install it with new GCC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants